﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/SiteContent.Master" Inherits="System.Web.Mvc.ViewPage<ProjectFitus.Models.NewsContent>" ValidateRequest="false" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Brjostagjof.is | Ný frétt
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">


    <h2>Búa til nýja frétt</h2>

    <% using (Html.BeginForm()) {%>

    <%//Setti ValidationSummary inn, við tókum hana út í gær. %>
    <%= Html.ValidationSummary(true) %>
        <fieldset>
            <legend> Ný frétt </legend>

            <div class="editor-label">
                <label for="isActive">Birta frétt:</label>
            </div>
            <div class="editor-field">
                <input type="checkbox" name="isActive" id="isActive" checked="checked" />
            </div>
                        
            <div class="editor-label">
                <label for="title">Fyrirsögn:</label>
            </div>
            <div class="editor-field">
                <%= Html.TextBoxFor(model => model.title) %>
                <%= Html.ValidationMessageFor(model => model.title) %>
            </div>

            <div class="editor-label">
                <label for="contentText">Flokkur:</label>
            </div>
            <div class="editor-field">
            <%= Html.DropDownList("Cats", ViewData["Cats"] as SelectList) %>
            </div>

            <div class="editor-label">
                <label for="contentText">Efni fréttar:</label>
            </div>
            <div class="editor-field">
                <%= Html.TextAreaFor(model => model.contentText)%>  
                <script type="text/javascript">CKEDITOR.replace('contentText');</script>
                <%= Html.ValidationMessageFor(model => model.contentText)%>
            </div>
          
            <div class="editor-label">
                <label for="introText">Útdráttur:</label>
            </div>
            <div class="editor-field">
                <%= Html.TextAreaFor(model => model.introText) %>
                <script type="text/javascript">                    CKEDITOR.replace('introText');</script>             
                <%= Html.ValidationMessageFor(model => model.introText) %>
            </div>
            
            <p>
                <input type="submit" value="Vista" />
            </p>
        </fieldset>

    <% } %>
    
    <div>
        <%= Html.ActionLink("Aftur í fréttalista", "Index") %>
    </div>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server">
    <script src="../../Scripts/MicrosoftAjax.js" type="text/javascript"></script>
    <script src="../../Scripts/MicrosoftMvcValidation.js" type="text/javascript"></script>
    <script type="text/javascript" src="../../Scripts/ckeditor/ckeditor.js"></script>
</asp:Content>


